import React, { Component, lazy, Suspense } from "react"
import Loading from "./loading"
// 路由懒加载
const Home = lazy(() => import("../Home"))
const About = lazy(() => import("../About"))

export default class lazyLoad extends Component {
  render() {
    return (
      <>
        <div>lazyLoad</div>
        <Suspense fallback={<Loading></Loading>}>
          <Route path="/home" component={Home}></Route>
          <Route path="/about" component={About}></Route>
        </Suspense>
      </>
    )
  }
}
